﻿using System;
using Zadani09.util;

namespace Zadani09.design
{
    public partial class UmelecM : System.Web.UI.MasterPage
    {
        protected void Page_Init(object sender, EventArgs e)
        {
            LogoutButton.Click += new EventHandler(LogoutButton_Click);
        }

        void LogoutButton_Click(object sender, EventArgs e)
        {
            //smazani informace o uzivateli
            smazZeSession(Constants.PRIHLASENY_UMELEC);
            this.Server.Transfer("~/Redir.aspx"); //forward, bohuzel na /admin/Default.aspx (nenacitaji se obrazky menicka
            // this.Server.TransferRequest("~/Default.aspx"); Tato operace vyžaduje integrovaný režim kanálu IIS.
        }
        
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        private void smazZeSession(string key)
        {
            this.Context.Session[key] = null;
        }
    }
}
